﻿using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using RestSharp.Serializers;

namespace SCM.Common.SMS
{
    public class MTSerializer : ISerializer
    {
        public MTSerializer()
        {
            this.ContentType = "application/json";
        }

        public string ContentType { get; set; }
        public string DateFormat { get; set; }
        public string Namespace { get; set; }
        public string RootElement { get; set; }

        public string Serialize(object obj)
        {
            JsonSerializerSettings jsonSerializer = new JsonSerializerSettings();
            jsonSerializer.ContractResolver = new CamelCasePropertyNamesContractResolver();
            return JsonConvert.SerializeObject(obj, jsonSerializer);
        }
    }
}
